﻿using ajayumi.develop.win32.Transport.WCF.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ajayumi.develop.win32.Transport.AppUpgrade
{
    /// <summary>
    /// 更新文件集合
    /// Author   : 黄乙冬
    /// Date     : 2011-09-01
    /// </summary>
    public class UpgradeFileCollection : TransFileCollection
    {
        #region Variables

        private int m_DownloadedCount = 0;

        #endregion

        #region Properties

        /// <summary>
        /// 总共要升级的文件数
        /// </summary>
        public int TotalUpgradeFile { get; private set; }

        public bool IsCompleted
        {
            get
            {
                return this.TotalUpgradeFile == this.m_DownloadedCount;
            }
        }

        #endregion

        public UpgradeFileCollection(int total)
            : base()
        { this.TotalUpgradeFile = total; }

        public override void TransFileCompleted(TransCompletedEventArgs e)
        {
            base.TransFileCompleted(e);
            this.m_DownloadedCount++;
        }
    }
}
